<?php

/** libraries
 * http://docs.joomla.org/JToolBarHelper
 */

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import Joomla view library
jimport('joomla.application.component.view');

class bgViewbg extends JView
{
	// Overwriting JView display method
	function display($tpl = null) 
	{
        $model = $this->getModel();
        $task = &JRequest::getVar('task');
        switch($task){
            case 'detail':
                $this->setLayout('detail');
                $cid = JRequest::getVar('cid');
                //$this->cain=$model->getAllCain();
//                $this->rows = $model->load($cid[0]);
//                $this->users = $model->loadusin($cid[0]);
            break;
            
            case 'download':
                $cid = JRequest::getVar('cid');
                $dowi_path = $model->getDowiPath($cid);
                $this->path_file = "uploads/files/com_download/".$dowi_path;
                $this->setLayout('default_download');
                
            break;
            
            default :
                $this->setLayout('default');
                  
                $this->cadm=$model->getAllCadm();
                
                $this->list = &JRequest::getVar('jform');

                
               $this->rows = $model->getAll($this->list);
               $this->pagination =& $this->get('Pagination');
        }
        
		parent::display();
	}
}




